package util

import "strconv"

func StringInList(target string, strArray []string) bool {
	for _, element := range strArray {
		if target == element {
			return true
		}
	}
	return false
}

func StringListToInt64List(stringList []string) ([]int64, error) {
	list := make([]int64, len(stringList))
	for index, item := range stringList {
		num, err := strconv.Atoi(item)
		if err != nil {
			return list, err
		}
		list[index] = int64(num)
	}
	return list, nil
}